package com.gccloud.design.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gccloud.design.dto.BwpBusinessProcessDto;
import com.gccloud.design.entity.BwpBusinessProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 流程定制 - DAO层接口
 *
 * @author guo.wang
 **/
@Mapper
public interface ProcessCustomDao extends BaseMapper<BwpBusinessProcessEntity> {
    /**
     * 流程定制树
     *
     * @param pId 父节点id
     * @return List<Map < String, Object>>
     */
    List<Map<String, Object>> getProcessTree(@Param("pId") Integer pId);

    /**
     * 新增流程
     *
     * @param bwpBusinessProcessDto 流程实例
     * @return 新增数量
     */
    int insertProcess(@Param("bwpBusinessProcessDto") BwpBusinessProcessDto bwpBusinessProcessDto);

    /**
     * 更新流程
     *
     * @param bwpBusinessProcessDto 流程实例
     * @return 修改数量
     */
    int updateProcess(@Param("bwpBusinessProcessDto") BwpBusinessProcessDto bwpBusinessProcessDto);

    /**
     * 删除流程
     *
     * @param bpId 流程实例
     * @return 删除数量
     */
    int deleteProcess(@Param("bpId") String bpId);
}
